//
//  ViewController.m
//  mhome
//
//  Created by 刘春雷 on 2018/11/26.
//  Copyright © 2018年 刘春雷. All rights reserved.
//

#import "ViewController.h"
#import "BrandViewController.h"
#import "ConstructionViewController.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    //产品
    BrandViewController *brandView = [[BrandViewController alloc]init];
    UINavigationController *nvc1 = [[UINavigationController alloc]initWithRootViewController:brandView];
    nvc1.navigationBar.translucent = NO;
    UIImage *imagenBrand = [[UIImage imageNamed:@"unquality"]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    UIImage *selecteimageBrand = [[UIImage imageNamed:@"quality"]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    nvc1.tabBarItem = [[UITabBarItem alloc]initWithTitle:@"品牌" image:imagenBrand selectedImage:selecteimageBrand];
    
    //施工
    ConstructionViewController *constructionView = [[ConstructionViewController alloc]init];
    UINavigationController *nvc2 = [[UINavigationController alloc]initWithRootViewController:constructionView];
    nvc2.navigationBar.translucent = NO;
    UIImage *imagenConstruction = [[UIImage imageNamed:@"unquality"]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    UIImage *selecteimageConstruction = [[UIImage imageNamed:@"quality"]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    nvc2.tabBarItem = [[UITabBarItem alloc]initWithTitle:@"施工" image:imagenConstruction selectedImage:selecteimageConstruction];
    
    BrandViewController *detachView = [[BrandViewController alloc]init];
    UINavigationController *nvc3 = [[UINavigationController alloc]initWithRootViewController:detachView];
    nvc3.navigationBar.translucent = NO;
    UIImage *imagenmDetach = [[UIImage imageNamed:@"unquality"]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    UIImage *selecteimageDetach = [[UIImage imageNamed:@"quality"]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    nvc3.tabBarItem = [[UITabBarItem alloc]initWithTitle:@"预约" image:imagenmDetach selectedImage:selecteimageDetach];
    
    BrandViewController *brand1View = [[BrandViewController alloc]init];
    UINavigationController *nvc4 = [[UINavigationController alloc]initWithRootViewController:brand1View];
    nvc4.navigationBar.translucent = NO;
    UIImage *imagenmain = [[UIImage imageNamed:@"unquality"]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    UIImage *selecteimagemain = [[UIImage imageNamed:@"quality"]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    nvc4.tabBarItem = [[UITabBarItem alloc]initWithTitle:@"我的" image:imagenmain selectedImage:selecteimagemain];
    
    UITabBarController *tab = [[UITabBarController alloc]init];
    tab.viewControllers = @[nvc1,nvc2,nvc3,nvc4,];
    tab.tabBar.translucent = NO;
    [tab setSelectedIndex:1];
    [UIApplication sharedApplication].delegate.window.rootViewController=tab;
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end
